<?php 
	require("funkcie.php");
	/*session_start();
	if(!isset($_SESSION['success']) || $_SESSION['success'] != true) die("Pruser, nie si zalogovany");
		else {
			session_destroy();
	*/
	
	$sql = connectDB();

	if(isset($_GET["id"]) && $_GET["id"] > 0) {
		$query = "SELECT name, type, location FROM devices WHERE id=".mysql_real_escape_string($_GET["id"]);
		$res = mysql_query($query);
		if(!res) die("Zlyhal select z DB (device.php, line 14");
		if(mysql_num_rows($res) > 0) {
			$name = mysql_result($res, 0, 0);
			$type = mysql_result($res, 0, 1);
			$loc = mysql_result($res, 0, 2);
		}
	}
?>

<!DOCTYPE html PUBLIC "-//W3C//Dth XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/Dth/xhtml1-transitional.dth">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta name="author" content="matuldo" />
	<link rel="stylesheet" type="text/css" href="hpinfo.css" />
	<script type="text/javascript" src="prototype.js"></script>
	<script type="text/javascript" src="fcie.js"></script>

	<title>HP INFO</title>
</head>

<body>

	<!-- Top menu -->
	<div class="top_menu">
		<img src="./Images/logo2.jpg" alt="HP INFO"/>
	</div>


	<!-- Left menu -->
	<div class="left_menu">
		<ul id="menu">
		<?php
		generateLeftMenu();
		?>
		</ul>
	</div>

	<!-- Content window -->
	<fieldset class="content" id="content">
	<legend>
	&nbsp;
	<?php
		if(isset($type) && $type != "")
			echo "<a href='devices.php?type=".$type."'>".getName("devicetypes",$type)."</a>";
		if(isset($loc) && $loc != "")
			echo " - <a href='devices.php?type=".$type."&loc=".$loc."'>".getName("locations",$loc)."</a>";
		if(isset($name) && $name != "")
			echo " - ".$name;
	?>
	
	&nbsp;
	</legend>

	<table class="content">
		
	</table>

</body>

</html>

<?php
	disconnectDB($sql);
?>